<?php
require_once('config.php');

$oder=$_GET['oder'];

$sql="select * from userinfo  order by id $oder ";

$result=mysqli_query($conn,$sql);

$obj=array();
while($data=mysqli_fetch_array($result)){
$arr=array();
$arr['id']=$data['id'];
$arr['username']=$data['username'];
$arr['password']=$data['password'];
$arr['telephone']=$data['telephone'];
$obj[]=$arr;
}

$data=array();

$data['data']=$obj;
$data['code']=1;
$data['msg']='成功';

echo json_encode($data);